package com.jstyle.jclifexd.dao;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.util.Log;

import org.greenrobot.greendao.database.Database;

/**
 * Created by Administrator on 2017/5/19.
 */

public class MySqlLiteOpenHelper extends DaoMaster.OpenHelper {
    private static final String TAG = "MySqlLiteOpenHelper";
    public MySqlLiteOpenHelper(Context context, String name) {
        super(context, name);
    }

    public MySqlLiteOpenHelper(Context context, String name, SQLiteDatabase.CursorFactory factory) {
        super(context, name, factory);
    }

    @Override
    public void onUpgrade(Database db, int oldVersion, int newVersion) {
        Log.i(TAG,"oldVersion:"+oldVersion+",newVersion"+newVersion);
        MigrationHelper.getInstance().migrate(db,BindDeviceInfoDao.class,StepDataDao.class,GpsDataDao.class, StepDetailDataDao.class, UserInfoDao.class,
                PathRecordDao.class,HealthDataDao.class,HeartDataDao.class,NotifyDataDao.class,SleepDataDao.class,StepDataerrorDao.class,LastActivityDataDao.class,BodyFatDataDao.class
        ,PathRecorderrorDao.class,TemperatureHistoryDataDao.class);

    }
}
